package com.ceres.farm.dao;

import com.ceres.farm.pojo.CustFarmlandCrops;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface CustFarmlandCropsMapper extends Mapper<CustFarmlandCrops> {
    //根据大田ID查询大田农作物
    @Select("SELECT * FROM t_cust_farmland_crops WHERE fid=#{id}")
   CustFarmlandCrops findNameById(@Param("id") Integer id);

    @Update("UPDATE t_cust_farmland_crops SET `stage` = #{stage},end_time=#{endTime} WHERE `fid` = #{id}")
    Integer updateStage(@Param("stage") String stage,@Param("id") Integer id,@Param("endTime") String endTime);
        //根据大田ID查询农作物名称
    @Select("select * from t_cust_farmland_crops where fid=#{fid}")
    CustFarmlandCrops findCrops(Integer fid);
}
